package spring;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.scheduling.annotation.EnableAsync;
import spring.event.RandomEvent;

/**
 * @author huu
 * @create 2025-08-25-14:32
 */
@SpringBootApplication
@EnableAsync//开启异步
public class App {
    public static void main(String[] args) {
        SpringApplication.run(App.class, args);
        //对于PostConstruct注解的事件发布是不生效的，可以移动到这来
        //获取IOC容器,容器来发布
//        ConfigurableApplicationContext run = SpringApplication.run(App.class, args);
//        run.publishEvent(new RandomEvent(run));

    }
}
